#include "cpu/exec/template-start.h"

#define instr leave

make_helper(instr) {
    swaddr_t addr;
    for(addr = cpu.esp; addr < cpu.ebp; addr += DATA_BYTE) {
        MEM_W(addr, 0);
    }
    cpu.esp = cpu.ebp;
    cpu.ebp = MEM_R(cpu.esp);
    cpu.esp += DATA_BYTE;
    print_asm("leave");
    return 1;
}

#include "cpu/exec/template-end.h"